/*
 * gpt.c
 *
 *  Created on: Feb 22, 2013
 *      Author: btgarber
 */

#include "common.h"


void gpt_init()
{
	// NUMBER 1 NEEDS TO BE LOOKED INTO
	MCF_GPIO_PTAPAR |= 1; 		//# 1 Configure the pin to perform GPT function.
	MCF_GPT_GPTIOS &= ~(7); // # 2
	MCF_GPT_GPTCTL2 |= 2; // # 3
	MCF_GPIO_DDRTA &= 0 ;//~(1);
	MCF_GPT_GPTDDR &= ~(15); // # 4
	MCF_GPT_GPTIE |= 1; // # 5
	MCF_GPT_GPTSCR1 |= 1 << 7; // # 6
	set_gpt_handler(64+44, gpt_handler);
	
	
	// NUMBER 7 NEEDS TO BE LOOKED INTO
	
	
}